<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>Spring.NET学习笔记1——控制反转(基础篇) Level 200 - 刘冬的备忘录 - 博客园</title>
<meta name="keywords" content="Spring.NET,IoC,控制反转">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/GoodHelper/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/GoodHelper/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body><div style="border: 1px solid rgb(126, 152, 214); margin: 0px; padding: 1px; position: absolute; background-color: rgb(231, 247, 247); font-size: 14px; left: 3px; top: 3px; width: 138px; height: 22px; text-align: center; z-index: 99; display: none;" id="_dict_status"></div><div style="margin: 0px; padding: 0px; position: absolute; display: none; width: 240px; z-index: 98; background-color: rgb(255, 255, 255);" id="_dict_layer"><table style="border: 1px solid rgb(126, 152, 214);" border="0" cellpadding="0" cellspacing="0" width="240"><tbody><tr><td style="border: medium none ; margin: 0px; padding: 0px;" width="100%"><div style="border: medium none ; margin: 0px; padding: 0px; width: 240px; height: 20px; cursor: move; background-color: rgb(200, 218, 243); display: inline;"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="border: medium none ; margin: 0px; padding: 0pt 3px; background-color: rgb(200, 218, 243); color: rgb(26, 145, 0); font-size: 14px; line-height: 20px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;" id="_dict_title" name="_dict_title" align="left" height="20" width="60%">划词翻译 - Dict.CN</td><td style="border: medium none ; margin: 0px; padding: 0pt 3px; background-color: rgb(200, 218, 243); line-height: 20px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;" align="right" height="20" valign="middle"><a href="http://dict.cn/scb/" target="_top" title="生词本" style="border: medium none ; margin: 0px; padding: 0px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;" id="_dict_add" name="_dict_add"><img src="add.gif" style="border: medium none ; margin: 0px; padding: 0px; display: inline;" align="absmiddle" border="0"></a> <a href="http://dict.cn/" target="_top" title="详细解释" style="border: medium none ; margin: 0px; padding: 0px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;" id="_dict_detail" name="_dict_detail"><img src="detail.gif" style="border: medium none ; margin: 0px; padding: 0px; display: inline;" align="absmiddle" border="0"></a> <a href="http://dict.cn/foot/help.htm" target="_top" title="帮助" style="border: medium none ; margin: 0px; padding: 0px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;"><img src="help.gif" style="border: medium none ; margin: 0px; padding: 0px; display: inline;" align="absmiddle" border="0"></a> <a href="javascript:_dictClose()" title="关闭" target="_self" style="border: medium none ; margin: 0px; padding: 0px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;"><img src="close.gif" style="border: medium none ; margin: 0px; padding: 0px; display: inline;" align="absmiddle" border="0"></a></td></tr></tbody></table></div><table style="border: medium none ; margin: 0px; padding: 0px;" align="center" border="0" cellpadding="3" cellspacing="4" width="100%"><tbody><tr><td style="border: medium none ; margin: 0px; padding: 0px;"><fieldset color="#00c0ff" style="margin: 0px; padding: 0pt 2px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;"><legend align="center" style="margin: 0px; padding: 0px;"><a href="http://dict.cn/" target="_top" style="border: medium none ; margin: 0px; padding: 0px;"><img src="qdict.gif" border="0" height="53" width="126"></a></legend><table style="border: medium none ; margin: 0px; padding: 0px;" align="center" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="border: medium none ; margin: 0px; padding: 0px;" id="_dictContent" name="_dictContent" height="120" width="100%"><iframe id="_dictFrame" name="_dictFrame" src="index_1.html" frameborder="0" height="120" width="100%"></iframe></td></tr><tr align="center"><td style="border: medium none ; margin: 0px; padding: 0px; color: rgb(153, 153, 153); font-size: 10px; line-height: 18px; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;" height="18" valign="bottom" width="100%">©2003-2008 <a href="http://dict.cn/" target="_top" style="border: medium none ; margin: 0px; padding: 0px; color: rgb(46, 168, 237); font-size: 10px; line-height: 18px; text-decoration: none; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;">Dict.CN</a> <a href="http://dict.cn/" target="_top" style="border: medium none ; margin: 0px; padding: 0px; color: rgb(153, 153, 153); font-size: 10px; line-height: 18px; text-decoration: none; font-weight: normal; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;">海词</a></td></tr></tbody></table></fieldset></td></tr></tbody></table></td></tr></tbody></table></div>
    <form name="Form1" method="post" action="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        
<!--done-->
<div id="home">
<div id="header">
	<div id="blogTitle">
	<a id="lnkBlogLogo" href="http://www.cnblogs.com/GoodHelper/"><img id="blogLogo" src="logo.gif" alt="返回主页"></a>			
		
<!--done-->
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/GoodHelper/">刘冬的备忘录</a></h1>
<h2>打造新疆第一敏捷团队</h2>



		
	</div><!--end: blogTitle 博客的标题和副标题 -->
	<div id="navigator">
		
<!--done-->
			<ul id="navList">
				<li><a id="MyLinks1_HomeLink" class="menu" href="http://www.cnblogs.com/">博客园</a></li>
				<li><a id="MyLinks1_SpaceLink" class="menu" href="http://space.cnblogs.com/">社区</a></li>
				<li><a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/GoodHelper/">首页</a></li>
				<li><a id="MyLinks1_NewPostLink" class="menu" href="http://www.cnblogs.com/GoodHelper/admin/EditPosts.aspx?opt=1">新随笔</a></li>
				<li><a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/%e5%88%98%e5%86%ac.NET">联系</a></li>
				<li><a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/GoodHelper/admin/EditPosts.aspx">管理</a></li>
				<li><a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/GoodHelper/rss">订阅</a>
				<a id="MyLinks1_XMLLink" class="aHeaderXML" href="http://www.cnblogs.com/GoodHelper/rss"><img src="rss.gif" alt="订阅" style="border-width: 0px;"></a></li>
			</ul>


		<div class="blogStats">
			
			
<!--done-->
随笔- 32&nbsp;
文章- 2&nbsp;
评论- 226&nbsp;

			
		</div><!--end: blogStats -->
	</div><!--end: navigator 博客导航栏 -->
</div><!--end: header 头部 -->

<div id="main">
	<div id="mainContent">
	<div class="forFlow">
		
					
<!--done-->
<div id="topics">
	<div class="post">
		<h1 class="postTitle">
			<a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html">Spring.NET学习笔记1——控制反转(基础篇) Level 200</a>
		</h1>
		<div class="clear"></div>
		<div class="postBody">
			<p>　　在学习Spring.NET这个控制反转(IoC)和面向切面(AOP)的容器框架之前，我们先来看一下什么是<strong>控制反转</strong>(IoC)。</p>
<p><strong>　　控制反转（Inversion of Control，英文缩写为IoC）</strong>，也叫<strong>依赖注入（Dependency Injection）</strong>。我个人认为控制反转的意思是依赖对象(控制权)发生转变，由最初的类本身来管理依赖对象转变为IoC框架来管理这些对象，使得依赖脱离类本身的控制，从而实现松耦合。</p>
<p>我们先来看一段代码</p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_234527" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_234527').style.display='none'; document.getElementById('Code_Open_Image_234527').style.display='inline'; document.getElementById('Code_Open_Text_234527').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_234527" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_234527').style.display='none'; getElementById('Code_Closed_Image_234527').style.display='inline'; getElementById('Code_Closed_Text_234527').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_234527">Code</span><span id="Code_Open_Text_234527" style="display: inline;"><br><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;Dao<br><img id="Codehighlighter1_14_226_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_14_226_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_14_226_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_14_226_Closed_Text').style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_14_226_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_14_226_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_14_226_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_14_226_Open_Text').style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_14_226_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_14_226_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">interface</span><span style="color: rgb(0, 0, 0);">&nbsp;IPersonDao<br><img id="Codehighlighter1_52_80_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_52_80_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_52_80_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_52_80_Closed_Text').style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_52_80_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_52_80_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_52_80_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_52_80_Open_Text').style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_52_80_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_52_80_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;Save();<br><img alt="" src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img alt="" src="inblock.gif" align="top"><br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;PersonDao&nbsp;:&nbsp;IPersonDao<br><img id="Codehighlighter1_126_224_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_126_224_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_126_224_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_126_224_Closed_Text').style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_126_224_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_126_224_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_126_224_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_126_224_Open_Text').style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_126_224_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_126_224_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;Save()<br><img id="Codehighlighter1_163_218_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_163_218_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_163_218_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_163_218_Closed_Text').style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_163_218_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_163_218_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_163_218_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_163_218_Open_Text').style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_163_218_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_163_218_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">保存&nbsp;Person</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br><img alt="" src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img alt="" src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img alt="" src="expandedblockend.gif" align="top">}</span></span><span style="color: rgb(0, 0, 0);"><br><img alt="" src="none.gif" align="top"><br><img alt="" src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;SpringNetIoC<br><img id="Codehighlighter1_251_458_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_251_458_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_251_458_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_251_458_Closed_Text').style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_251_458_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_251_458_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_251_458_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_251_458_Open_Text').style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_251_458_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_251_458_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Program<br><img id="Codehighlighter1_275_456_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_275_456_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_275_456_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_275_456_Closed_Text').style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_275_456_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_275_456_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_275_456_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_275_456_Open_Text').style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_275_456_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_275_456_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;NormalMethod()<br><img id="Codehighlighter1_328_450_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_328_450_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_328_450_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_328_450_Closed_Text').style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_328_450_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_328_450_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_328_450_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_328_450_Open_Text').style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_328_450_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="dot.gif"></span><span id="Codehighlighter1_328_450_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IPersonDao&nbsp;dao&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;PersonDao();<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.Save();<br><img alt="" src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">我是一般方法</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br><img alt="" src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img alt="" src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img alt="" src="expandedblockend.gif" align="top">}</span></span></span></div>
<p>&nbsp;</p>
<p>Program必然需要知道IPersonDao接口和PersonDao类。为了不暴露具体实现，我可以运用设计模式中的抽象工厂模式（Abstract Factory）来解决。</p>
<p>&nbsp;</p>
<div class="cnblogs_code"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;DaoFactory<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;DataAccess<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;IPersonDao&nbsp;CreatePersonDao()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;PersonDao();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</span></div>
<p>&nbsp;</p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_235238" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_235238').style.display='none'; document.getElementById('Code_Open_Image_235238').style.display='inline'; document.getElementById('Code_Open_Text_235238').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_235238" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_235238').style.display='none'; getElementById('Code_Closed_Image_235238').style.display='inline'; getElementById('Code_Closed_Text_235238').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_235238">FactoryMethod</span><span id="Code_Open_Text_235238" style="display: inline;"><br><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;SpringNetIoC<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Program<br>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;FactoryMethod()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IPersonDao&nbsp;dao&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DataAccess.CreatePersonDao();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.Save();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">我是工厂方法</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br></span></span></div>
<p>这时，Program只需要知道IPersonDao接口和工厂，而不需要知道PersonDao类。然后我们试图想象，要是有这样的工厂框架帮我们管理依赖的对象就好了，于是控制反转出来了。</p>
<p>&nbsp;</p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_235944" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_235944').style.display='none'; document.getElementById('Code_Open_Image_235944').style.display='inline'; document.getElementById('Code_Open_Text_235944').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_235944" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_235944').style.display='none'; getElementById('Code_Closed_Image_235944').style.display='inline'; getElementById('Code_Closed_Text_235944').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_235944">App.config</span><span id="Code_Open_Text_235944" style="display: inline;"><br><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">&lt;?</span><span style="color: rgb(255, 0, 255);">xml&nbsp;version="1.0"&nbsp;encoding="utf-8"&nbsp;</span><span style="color: rgb(0, 0, 255);">?&gt;</span><span style="color: rgb(0, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">configuration</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">configSections</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">sectionGroup&nbsp;</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="spring"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">section&nbsp;</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="context"</span><span style="color: rgb(255, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 255);">="Spring.Context.Support.ContextHandler,&nbsp;Spring.Core"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">section&nbsp;</span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="objects"</span><span style="color: rgb(255, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 255);">="Spring.Context.Support.DefaultSectionHandler,&nbsp;Spring.Core"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">sectionGroup</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">configSections</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">spring</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">context</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">resource&nbsp;</span><span style="color: rgb(255, 0, 0);">uri</span><span style="color: rgb(0, 0, 255);">="config://spring/objects"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">context</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">objects&nbsp;</span><span style="color: rgb(255, 0, 0);">xmlns</span><span style="color: rgb(0, 0, 255);"><span>="<a href="http://www.springframework.net/" class="smarterwiki-linkify">http://www.springframework.net</a>"</span></span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">一个简单的控制反转例子</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">description</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">object&nbsp;</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="PersonDao"</span><span style="color: rgb(255, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 255);">="Dao.PersonDao,&nbsp;Dao"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">objects</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">spring</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">configuration</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br></span></span></div>
<p>&nbsp;</p>
<div class="cnblogs_code"><img style="display: none;" id="Code_Closed_Image_000028" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_000028').style.display='none'; document.getElementById('Code_Open_Image_000028').style.display='inline'; document.getElementById('Code_Open_Text_000028').style.display='inline';" src="contractedblock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_000028" style="display: inline;" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_000028').style.display='none'; getElementById('Code_Closed_Image_000028').style.display='inline'; getElementById('Code_Closed_Text_000028').style.display='inline';" src="expandedblockstart.gif" align="top" height="16" width="11"><span style="display: none;" class="cnblogs_code_Collapse" id="Code_Closed_Text_000028">Program</span><span id="Code_Open_Text_000028" style="display: inline;"><br><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Collections.Generic;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Linq;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Text;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;Dao;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;DaoFactory;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;Spring.Context;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;Spring.Context.Support;<br><br></span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;SpringNetIoC<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Program<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;Main(</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">[]&nbsp;args)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">NormalMethod();&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;一般方法<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">FactoryMethod();&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;工厂方法</span><span style="color: rgb(0, 128, 0);"><br></span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IoCMethod();&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;IoC方法"</span><span style="color: rgb(0, 128, 0);"><br></span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.ReadLine();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;NormalMethod()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IPersonDao&nbsp;dao&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;PersonDao();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.Save();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">我是一般方法</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;FactoryMethod()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IPersonDao&nbsp;dao&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DataAccess.CreatePersonDao();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.Save();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">我是工厂方法</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;IoCMethod()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IApplicationContext&nbsp;ctx&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;ContextRegistry.GetContext();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IPersonDao&nbsp;dao&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;ctx.GetObject(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">PersonDao</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span style="color: rgb(0, 0, 255);">as</span><span style="color: rgb(0, 0, 0);">&nbsp;IPersonDao;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(dao&nbsp;</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.Save();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">我是IoC方法</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br></span></span></div>
<p>一个简单的控制反转程序例子就实现了。</p>
<p>这样从一定程度上解决了Program与PersonDao耦合的问题，但是实际上并没有完全解决耦合，只是把耦合放到了XML 文件中，通过一个容器在需要的时候把这个依赖关系形成，即把需要的接口实现注入到需要它的类中。我个人认为可以把IoC模式看做是工厂模式的升华，可以把IoC看作是一个大工厂，只不过这个大工厂里要生成的对象都是在XML文件中给出定义的。</p>
<p><a title="代码下载" style="color: rgb(255, 153, 204);" href="http://files.cnblogs.com/GoodHelper/SpringNet_Lesson1.rar" target="_top">代码下载</a></p>
<p>我最近也是在学习Spring.NET，如果有和我不同意见的朋友可以给我留言或者发送EMail，我们可以约定时间共同学习和探讨。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>　　<a href="http://www.cnblogs.com/GoodHelper/archive/2009/11/20/SpringNet_Index.html" target="_top">返回目录</a></p><div id="EntryTag">Tag标签: <a href="http://www.cnblogs.com/GoodHelper/tag/Spring.NET/">Spring.NET</a>,<a href="http://www.cnblogs.com/GoodHelper/tag/IoC/">IoC</a>,<a href="http://www.cnblogs.com/GoodHelper/tag/%e6%8e%a7%e5%88%b6%e5%8f%8d%e8%bd%ac/">控制反转</a></div>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1589354,58949,1)"> 
		<span class="diggnum" id="digg_count_1589354">3</span>
	</div>
	<div class="buryit" onclick="DiggIt(1589354,58949,2)"> 
		<span class="burynum" id="bury_count_1589354">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1589354">0</span>	
	<div class="diggword" id="digg_word_1589354">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/GoodHelper/archive/2009/10/18/Linq2NHibernate_select.html">« </a> 上一篇：<a href="http://www.cnblogs.com/GoodHelper/archive/2009/10/18/Linq2NHibernate_select.html" title="发布于2009-10-18 23:48">10分钟搞定Linq to NHibernate(二)——查询篇</a><br>
<a href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/SpringNET_Config.html">» </a> 下一篇：<a href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/SpringNET_Config.html" title="发布于2009-10-25 02:17">Spring.NET学习笔记2——环境搭建(基础篇) Level 200</a><br>
</div>








		</div>
		<div class="postDesc">posted @ 2009-10-25 00:20 <a href="http://www.cnblogs.com/GoodHelper/">刘冬.NET</a> 阅读(3087) <a href="#commentform">评论(22)</a> &nbsp;<a href="http://www.cnblogs.com/GoodHelper/admin/EditPosts.aspx?postid=1589354">编辑</a> <a href="http://www.cnblogs.com/GoodHelper/AddToFavorite.aspx?id=1589354">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/GoodHelper/category/215413.html">Spring.NET</a></div>
	</div>
	<img src="1589354.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html"
dc:identifier="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/GoodHelper/services/trackbacks/1589354.aspx" />
</rdf:RDF>
-->

</div><!--end: topics 文章、评论容器-->
<a name="pagedcomment"></a>
<!--done-->
<br>
<div class="feedback_area_title">发表评论</div>
<div class="feedbackNoItems"><span id="span_comment_maxid" style="display: none;">1741318</span></div>
	

		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("我是一只小老虎 喵!",1680521,"o6Uz1n92krDwzRMxeOXuVc71i+0bVIYQ5oUXxy9J2C7vfU/eTwFR3g==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680521,"o6Uz1n92krDwzRMxeOXuVc71i+0bVIYQ5oUXxy9J2C7vfU/eTwFR3g==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%88%91%e6%98%af%e4%b8%80%e5%8f%aa%e5%b0%8f%e8%80%81%e8%99%8e+%e5%96%b5%21" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680521">#1楼</a><a name="1680521" id="comment_anchor_1680521"></a>2009-10-25 01:10 | <a id="Comments1_CommentList_ctl00_NameLink" href="http://www.cnblogs.com/jsonchou/" target="_top">我是一只小老虎 喵!</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%88%91%e6%98%af%e4%b8%80%e5%8f%aa%e5%b0%8f%e8%80%81%e8%99%8e+%e5%96%b5%21" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680521" class="blog_comment_body">准备写系列吗？<br>好哇．我再重头学习一篇.<br><br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("我是一只小老虎 喵!",1680523,"o6Uz1n92krDwzRMxeOXuVc71i+0bVIYQ5oUXxy9J2C7vfU/eTwFR3g==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680523,"o6Uz1n92krDwzRMxeOXuVc71i+0bVIYQ5oUXxy9J2C7vfU/eTwFR3g==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%88%91%e6%98%af%e4%b8%80%e5%8f%aa%e5%b0%8f%e8%80%81%e8%99%8e+%e5%96%b5%21" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680523">#2楼</a><a name="1680523" id="comment_anchor_1680523"></a>2009-10-25 01:34 | <a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/jsonchou/" target="_top">我是一只小老虎 喵!</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%88%91%e6%98%af%e4%b8%80%e5%8f%aa%e5%b0%8f%e8%80%81%e8%99%8e+%e5%96%b5%21" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680523" class="blog_comment_body">个人更偏爱Unity一些，不过有人说MS的Unity做得很差-_-!<br><br>不是很喜欢这种更多的xml配置信息.JAVA那边的都喜欢这样搞吗?<br><br>Nhibernate也一样.<br><br>也不知道Unity到底在底层做了什么.<br><br><br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("落花吹雪",1680530,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680530,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680530">#3楼</a><a name="1680530" id="comment_anchor_1680530"></a>[<span class="louzhu">楼主</span>]2009-10-25 02:13 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/GoodHelper/" target="_top">落花吹雪</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680530" class="blog_comment_body"><a href="#1680523" title="查看所回复的评论">@</a>我是一只小老虎 喵!<br>可以不用配置xml，标记上Attribute就行的。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("麦子|君子兰",1680550,"jYxUvFF3hC7Z9XYIhOH+kEfkjlRXa6c+K/TTGweK5QPF74F5YXQJhg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680550,"jYxUvFF3hC7Z9XYIhOH+kEfkjlRXa6c+K/TTGweK5QPF74F5YXQJhg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%ba%a6%e5%ad%90%7c%e5%90%9b%e5%ad%90%e5%85%b0" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl03$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680550">#4楼</a><a name="1680550" id="comment_anchor_1680550"></a>2009-10-25 07:31 | <a id="Comments1_CommentList_ctl03_NameLink" href="http://www.cnblogs.com/mad/" target="_top">麦子|君子兰</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%ba%a6%e5%ad%90%7c%e5%90%9b%e5%ad%90%e5%85%b0" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680550" class="blog_comment_body">讲的很明白。继续学习中</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Allen Zhang",1680612,"xz+5qQLVMBN3r9UbdA9WD0gY6Se97AV5rys2KH9PF5uUxDCCetHaWQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680612,"xz+5qQLVMBN3r9UbdA9WD0gY6Se97AV5rys2KH9PF5uUxDCCetHaWQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Allen+Zhang" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl04$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680612">#6楼</a><a name="1680612" id="comment_anchor_1680612"></a>2009-10-25 10:04 | <a id="Comments1_CommentList_ctl04_NameLink" href="http://www.cnblogs.com/baoposhou/" target="_top">Allen Zhang</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Allen+Zhang" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680612" class="blog_comment_body">一直没体会到IoC能带来什么好处，解耦能带来工作量减少吗？<br>我觉得一大堆XML反而增加了工作量<br>客户提示系统修改的时侯，IoC并不能减少修改的工作量 <br>所以博主能说说IoC会给现在的开发带什么来好处吗？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("落花吹雪",1680614,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680614,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl05$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680614">#7楼</a><a name="1680614" id="comment_anchor_1680614"></a>[<span class="louzhu">楼主</span>]2009-10-25 10:09 | <a id="Comments1_CommentList_ctl05_NameLink" href="http://www.cnblogs.com/GoodHelper/" target="_top">落花吹雪</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680614" class="blog_comment_body"><a href="#1680610" title="查看所回复的评论">@</a>Allen Zhang<br>我认为IoC模式看做是工厂模式的升华，可以有选择的使用IoC(变化多的地方使用)，并不一定所有地方都用，如公共类库(Common)就没有必要用。因为Common的变化不大。可以把一个XML看作反射工厂，通过配置来改变具体的实现部分。工厂是不一定整个项目的所有地方都用的。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Allen Zhang",1680617,"xz+5qQLVMBN3r9UbdA9WD0gY6Se97AV5rys2KH9PF5uUxDCCetHaWQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680617,"xz+5qQLVMBN3r9UbdA9WD0gY6Se97AV5rys2KH9PF5uUxDCCetHaWQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Allen+Zhang" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl06$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680617">#8楼</a><a name="1680617" id="comment_anchor_1680617"></a>2009-10-25 10:12 | <a id="Comments1_CommentList_ctl06_NameLink" href="http://www.cnblogs.com/baoposhou/" target="_top">Allen Zhang</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Allen+Zhang" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680617" class="blog_comment_body"><a href="#1680614" title="查看所回复的评论">@</a>落花吹雪<br>工厂只是说更换某个实现类是有作用，比如我的SQLHelper换成OracleHelper<br>但实际开发过程中的修改，都是针对业务流程、数据项等的修改，这些用工厂好像也没什么作用。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("shenzhen",1680619,"zAQr9fpysVaBkEW26Q4hkjE8BMZazPkfyx4QnDx5fw7Oz+VZZ5hdOw==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680619,"zAQr9fpysVaBkEW26Q4hkjE8BMZazPkfyx4QnDx5fw7Oz+VZZ5hdOw==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=shenzhen" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl07$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680619">#9楼</a><a name="1680619" id="comment_anchor_1680619"></a>2009-10-25 10:13 | <a id="Comments1_CommentList_ctl07_NameLink" href="http://www.cnblogs.com/shenzhen003/" target="_top">shenzhen</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/shenzhen" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680619" class="blog_comment_body">呵呵。。。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("shenzhen",1680620,"zAQr9fpysVaBkEW26Q4hkjE8BMZazPkfyx4QnDx5fw7Oz+VZZ5hdOw==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680620,"zAQr9fpysVaBkEW26Q4hkjE8BMZazPkfyx4QnDx5fw7Oz+VZZ5hdOw==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=shenzhen" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl08$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680620">#10楼</a><a name="1680620" id="comment_anchor_1680620"></a>2009-10-25 10:14 | <a id="Comments1_CommentList_ctl08_NameLink" href="http://www.cnblogs.com/shenzhen003/" target="_top">shenzhen</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/shenzhen" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680620" class="blog_comment_body">呵呵。。谢谢楼主啦。。可以学习下什么是sprint.net啦</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("落花吹雪",1680622,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680622,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl09$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680622">#11楼</a><a name="1680622" id="comment_anchor_1680622"></a>[<span class="louzhu">楼主</span>]2009-10-25 10:19 | <a id="Comments1_CommentList_ctl09_NameLink" href="http://www.cnblogs.com/GoodHelper/" target="_top">落花吹雪</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680622" class="blog_comment_body"><a href="#1680617" title="查看所回复的评论">@</a>Allen Zhang<br>其实我认为真正变化大的不是xxHelper，而是业务流程。我觉得实际过程中一个项目更换数据的情况并不多，而修改业务流程的情况到比较普遍，如有2个客户，客户A用的是ServerA整个类，客户B用的是ServerB整个类，这时候就需要工厂来实现动态切换了:IServer server=Factory.CreateServer();</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Allen Zhang",1680627,"xz+5qQLVMBN3r9UbdA9WD0gY6Se97AV5rys2KH9PF5uUxDCCetHaWQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1680627,"xz+5qQLVMBN3r9UbdA9WD0gY6Se97AV5rys2KH9PF5uUxDCCetHaWQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Allen+Zhang" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl10$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1680627">#12楼</a><a name="1680627" id="comment_anchor_1680627"></a>2009-10-25 10:25 | <a id="Comments1_CommentList_ctl10_NameLink" href="http://www.cnblogs.com/baoposhou/" target="_top">Allen Zhang</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Allen+Zhang" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1680627" class="blog_comment_body"><a href="#1680622" title="查看所回复的评论">@</a>落花吹雪<br>嗯，你指的是利用工厂去选择相应的流程处理类，这是一种应用，呵呵。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一线风",1681328,"5jNUDVG+QQ8tlxGu4RXovUAUHx8jW5kEY4N6vQXymEvpGsl1RwjWKw==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1681328,"5jNUDVG+QQ8tlxGu4RXovUAUHx8jW5kEY4N6vQXymEvpGsl1RwjWKw==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%80%e7%ba%bf%e9%a3%8e" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl11$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1681328">#13楼</a><a name="1681328" id="comment_anchor_1681328"></a>2009-10-26 09:34 | <a id="Comments1_CommentList_ctl11_NameLink" href="http://www.cnblogs.com/atwind/" target="_top">一线风</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%80%e7%ba%bf%e9%a3%8e" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1681328" class="blog_comment_body"><fieldset class="comment_quote"><legend><a href="#1680622" title="查看引用原文">引用</a></legend>落花吹雪：<br>@Allen Zhang<br>其实我认为真正变化大的不是xxHelper，而是业务流程。我觉得实际过程中一个项目更换数据的情况并不多，而修改业务流程的情况到比较普遍，如有2个客户，客户A用的是ServerA整个类，客户B用的是ServerB整个类，这时候就需要工厂来实现动态切换了:IServer server=Factory.CreateServer();</fieldset><br><br>呵，想法差不多呀。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("lumnm",1681675,"+Fumzc/QAIJ+yYf/C2cxk3eMi1lpp9xLEpjc9/HKo7v9eDXzk8XPwQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1681675,"+Fumzc/QAIJ+yYf/C2cxk3eMi1lpp9xLEpjc9/HKo7v9eDXzk8XPwQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=lumnm" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl12$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1681675">#14楼</a><a name="1681675" id="comment_anchor_1681675"></a>2009-10-26 14:08 | <a id="Comments1_CommentList_ctl12_NameLink" href="http://www.cnblogs.com/lumnm/" target="_top">lumnm</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/lumnm" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1681675" class="blog_comment_body">不错，简单易懂。继续学习ing</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Rainbow",1681679,"/BKGeLyzgNbOg7IQWiugBRlYA4VsQod+A91asKxNcJuWthkKB226CA==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1681679,"/BKGeLyzgNbOg7IQWiugBRlYA4VsQod+A91asKxNcJuWthkKB226CA==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Rainbow" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl13$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1681679">#15楼</a><a name="1681679" id="comment_anchor_1681679"></a>2009-10-26 14:12 | <a id="Comments1_CommentList_ctl13_NameLink" href="http://www.cnblogs.com/yoyozhou/" target="_top">Rainbow</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Rainbow" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1681679" class="blog_comment_body"><a href="#1680523" title="查看所回复的评论">@</a>我是一只小老虎 喵!<br>个人觉得Unity，是个非常不错的东西，不过那个东西有太强的侵入性。那个东西MS一直比较喜欢，个人不喜欢，还是觉得xml的配置比较灵活和干净。<br>@Allen Zhang<br>当你的代码需要变动或者需要重新实现的时候，就会发现IOC的重要性了。要不别人不会犯傻弄这样的东西难为自己，你现在只是没有用到而已。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("ERic Poon",1681991,"wl1Ix3DeVea9LTXwtxxl+QSQBV9oGKwy3OYsKbXalccrmGi2RwyTtA==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1681991,"wl1Ix3DeVea9LTXwtxxl+QSQBV9oGKwy3OYsKbXalccrmGi2RwyTtA==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=ERic+Poon" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl14$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1681991">#16楼</a><a name="1681991" id="comment_anchor_1681991"></a>2009-10-26 18:10 | <a id="Comments1_CommentList_ctl14_NameLink" href="http://home.cnblogs.com/91011/" target="_top">ERic Poon</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/ERic+Poon" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1681991" class="blog_comment_body">Good good study<br>記錄下.</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("落花吹雪",1681995,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1681995,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl15$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1681995">#17楼</a><a name="1681995" id="comment_anchor_1681995"></a>[<span class="louzhu">楼主</span>]2009-10-26 18:12 | <a id="Comments1_CommentList_ctl15_NameLink" href="http://www.cnblogs.com/GoodHelper/" target="_top">落花吹雪</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%90%bd%e8%8a%b1%e5%90%b9%e9%9b%aa" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1681995" class="blog_comment_body"><a href="#1681991" title="查看所回复的评论">@</a>ERic Poon<br>thx</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("JJY",1695010,"uSzOgzipSAyUoR7d6WDsoc3Mz8lSXvFcsm3Fqo/8I0Bx19J0xu1O0Q==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1695010,"uSzOgzipSAyUoR7d6WDsoc3Mz8lSXvFcsm3Fqo/8I0Bx19J0xu1O0Q==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=JJY" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl16$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1695010">#18楼</a><a name="1695010" id="comment_anchor_1695010"></a>2009-11-11 10:46 | <a id="Comments1_CommentList_ctl16_NameLink" href="http://www.cnblogs.com/jiajinyi/" target="_top">JJY</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/JJY" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1695010" class="blog_comment_body">我觉得这只是利用反射来生成类（接口）对象，但是丝毫没有体会到这样做有什么好处。<br>PETSHOP中的反射工厂和这个是同一原理吧？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("陛下",1695065,"Ct7IDZPu0Ymz78E5QmjRzzByMj8Gyk2vMIump6AzyRiPjzmUsNzVcQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1695065,"Ct7IDZPu0Ymz78E5QmjRzzByMj8Gyk2vMIump6AzyRiPjzmUsNzVcQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%99%9b%e4%b8%8b" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl17$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1695065">#19楼</a><a name="1695065" id="comment_anchor_1695065"></a>2009-11-11 11:21 | <a id="Comments1_CommentList_ctl17_NameLink" href="http://www.cnblogs.com/howard-queen/" target="_top">陛下</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%99%9b%e4%b8%8b" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1695065" class="blog_comment_body">不久前我有与 Allen Zhang 类似的误解，是在我看了一些 j2ee 下的 struts 框架介绍后，感觉把编码变成 xml 编辑，其实是在弱化 ide 的工具功能，大量使用反射而已。<br>现在看来，把工程模块化，可自由组织（通过配置文件），对于软件商品的流水线生产大有好处，毕竟各模块可单独生产并无耦合复用了，唯一有约束的地方最多是“接口”，而这也是模块化生产的精髓！<br>产品不同于作品，尤其艺术品。产品是可复制的、可定制的，我看这是为何当前这些 IOC 或 ORM 等框架流行的原因。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("刘冬.NET",1695189,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1695189,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%88%98%e5%86%ac.NET" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl18$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1695189">#20楼</a><a name="1695189" id="comment_anchor_1695189"></a>[<span class="louzhu">楼主</span>]2009-11-11 12:45 | <a id="Comments1_CommentList_ctl18_NameLink" href="http://www.cnblogs.com/GoodHelper/" target="_top">刘冬.NET</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%88%98%e5%86%ac.NET" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1695189" class="blog_comment_body"><a href="#1695065" title="查看所回复的评论">@</a>陛下<br>同感</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("刘冬.NET",1695198,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1695198,"3r1xwsTrI4CV2TS68/JZDe8Nke98EOtx+8ZIuyP4wWjb/q4OPzhLUg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%88%98%e5%86%ac.NET" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl19$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1695198">#21楼</a><a name="1695198" id="comment_anchor_1695198"></a>[<span class="louzhu">楼主</span>]2009-11-11 12:50 | <a id="Comments1_CommentList_ctl19_NameLink" href="http://www.cnblogs.com/GoodHelper/" target="_top">刘冬.NET</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%88%98%e5%86%ac.NET" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1695198" class="blog_comment_body"><a href="#1695010" title="查看所回复的评论">@</a>JJY<br>IoC的确和反射工厂有类似道理，而且是工厂的升华版。<br>使用依赖注入或控制反转框架可以只暴露接口，而不暴露具体的实现部分。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("华丽的低调",1701084,"RU4rTDYDI3yxz7IWdlOgDjei2WlpuGogzMaaYiY7TXKe+O8AGEhtwg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1701084,"RU4rTDYDI3yxz7IWdlOgDjei2WlpuGogzMaaYiY7TXKe+O8AGEhtwg==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%8d%8e%e4%b8%bd%e7%9a%84%e4%bd%8e%e8%b0%83" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl20$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1701084">#22楼</a><a name="1701084" id="comment_anchor_1701084"></a>2009-11-18 09:31 | <a id="Comments1_CommentList_ctl20_NameLink" href="http://www.cnblogs.com/island21/" target="_top">华丽的低调</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%8d%8e%e4%b8%bd%e7%9a%84%e4%bd%8e%e8%b0%83" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1701084" class="blog_comment_body">Mark 学习。。。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("鹤冲天",1741318,"M6id96rJPqTYUDlY5MX5B3YviJB/4u7etDHNwrqpCYcAvgecLUKCQQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1741318,"M6id96rJPqTYUDlY5MX5B3YviJB/4u7etDHNwrqpCYcAvgecLUKCQQ==")' href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%b9%a4%e5%86%b2%e5%a4%a9" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl21$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1741318">#23楼</a><a name="1741318" id="comment_anchor_1741318"></a><a name="Post"></a>2010-01-06 11:24 | <a id="Comments1_CommentList_ctl21_NameLink" href="http://www.cnblogs.com/ldp615/" target="_top">鹤冲天</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%b9%a4%e5%86%b2%e5%a4%a9" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1741318" class="blog_comment_body">学习中...</span><br>
			</div>
		</div>
	

<div id="ctl05_comment_form" class="commentform">




<div id="ctl05_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fGoodHelper%2farchive%2f2009%2f10%2f25%2fSpring_NET_IoC.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fGoodHelper%2farchive%2f2009%2f10%2f25%2fSpring_NET_IoC.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55135/" target="_top">结盟零售蚁族 淘宝欲造10亿新网民</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55134/" target="_top">下代Android系统命名冻酸奶</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55133/" target="_top">上海张江定位之惑：像个房地产企业</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55132/" target="_top">盛大：并购合资不断 打造迪士尼式娱乐帝国</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55131/" target="_top">Google退出中国市场并非出于政治道德高仁</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_3.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="relative_search"><br><b>相关搜索:</b><br> <a href="http://zzk.cnblogs.com/s?w=Spring.NET" target="_top">Spring.NET</a> <a href="http://zzk.cnblogs.com/s?w=IoC" target="_top">IoC</a> <a href="http://zzk.cnblogs.com/s?w=%e6%8e%a7%e5%88%b6%e5%8f%8d%e8%bd%ac" target="_top">控制反转</a> <a href="http://zzk.cnblogs.com/s?w=Spring.NET" target="_top">Spring.NET</a> </div><div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/1589354/">Spring.NET学习笔记1——控制反转(基础篇) Level 200</a></div>

</div>


				
	</div><!--end: forFlow -->
	</div><!--end: mainContent 主体内容容器-->

	<div id="sideBar">
		<div id="sideBarMain">
			
<!--done-->
<div class="newsItem">
<h3 class="catListTitle">公告</h3>
	<div id="profile_block"><a href="http://home.cnblogs.com/GoodHelper/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/GoodHelper/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/GoodHelper/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/%e5%88%98%e5%86%ac.NET" target="_top">发短消息</a></div>
</div>

			
<div id="calendar">
<table id="Calendar1_entryCal" class="Cal" title="Calendar" border="0" cellpadding="0" cellspacing="0">
	<tbody><tr><td colspan="7"><table class="CalTitle" border="0" cellspacing="0">
		<tbody><tr><td class="CalNextPrev"><a href="javascript:__doPostBack('Calendar1$entryCal','V3622')" style="color: Black;" title="Go to the previous month">&lt;</a></td><td align="center">2010年1月</td><td class="CalNextPrev" align="right"><a href="javascript:__doPostBack('Calendar1$entryCal','V3684')" style="color: Black;" title="Go to the next month">&gt;</a></td></tr>
	</tbody></table></td></tr><tr><th class="CalDayHeader" abbr="日" scope="col" align="center">日</th><th class="CalDayHeader" abbr="一" scope="col" align="center">一</th><th class="CalDayHeader" abbr="二" scope="col" align="center">二</th><th class="CalDayHeader" abbr="三" scope="col" align="center">三</th><th class="CalDayHeader" abbr="四" scope="col" align="center">四</th><th class="CalDayHeader" abbr="五" scope="col" align="center">五</th><th class="CalDayHeader" abbr="六" scope="col" align="center">六</th></tr><tr><td class="CalOtherMonthDay" align="center">27</td><td class="CalOtherMonthDay" align="center">28</td><td class="CalOtherMonthDay" align="center">29</td><td class="CalOtherMonthDay" align="center">30</td><td class="CalOtherMonthDay" align="center">31</td><td align="center">1</td><td class="CalWeekendDay" align="center">2</td></tr><tr><td class="CalWeekendDay" align="center">3</td><td align="center">4</td><td align="center">5</td><td align="center">6</td><td align="center">7</td><td align="center">8</td><td class="CalWeekendDay" align="center">9</td></tr><tr><td class="CalWeekendDay" align="center">10</td><td align="center">11</td><td align="center">12</td><td align="center">13</td><td align="center">14</td><td align="center">15</td><td class="CalWeekendDay" align="center">16</td></tr><tr><td class="CalTodayDay" align="center">17</td><td align="center">18</td><td align="center">19</td><td align="center">20</td><td align="center">21</td><td align="center">22</td><td class="CalWeekendDay" align="center">23</td></tr><tr><td class="CalWeekendDay" align="center">24</td><td align="center">25</td><td align="center">26</td><td align="center">27</td><td align="center">28</td><td align="center">29</td><td class="CalWeekendDay" align="center">30</td></tr><tr><td class="CalWeekendDay" align="center">31</td><td class="CalOtherMonthDay" align="center">1</td><td class="CalOtherMonthDay" align="center">2</td><td class="CalOtherMonthDay" align="center">3</td><td class="CalOtherMonthDay" align="center">4</td><td class="CalOtherMonthDay" align="center">5</td><td class="CalOtherMonthDay" align="center">6</td></tr>
</tbody></table>
</div>

			
			<div id="leftcontentcontainer">
				

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<div class="catListLink">
<h3 class="catListTitle">常用链接</h3>
<ul>

		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl00_lnkLinkItem" href="http://www.cnblogs.com/GoodHelper/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl01_lnkLinkItem" href="http://home.cnblogs.com/GoodHelper/">我的空间</a></li>
	
		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl02_lnkLinkItem" href="http://space.cnblogs.com/msg/recent">我的短信</a></li>
	
		<li><a id="SingleColumn1_ctl02_rptMainLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/GoodHelper/MyComments.html">我的评论</a></li>
	
<li><a id="itemListLink" onclick="this.blur();WarpClass('itemListLink', 'itemListLin_con');return false;" href="#">更多链接</a></li>
</ul>
<div id="itemListLin_con" style="display: none;">
<ul>

		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl00_lnkLinkItem" title="我发表过评论的随笔" href="http://www.cnblogs.com/GoodHelper/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl01_lnkLinkItem" href="http://www.cnblogs.com/GoodHelper/MyNews.html">我的新闻</a></li>
	
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/GoodHelper/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn1_ctl02_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/GoodHelper/tag/">我的标签</a></li>
	
</ul>
</div>
</div>

<div class="catListTag">
<h3 class="catListTitle">我的标签</h3>
<ul>
<li><a href="http://www.cnblogs.com/GoodHelper/tag/Spring.NET/">Spring.NET</a>(30)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/NHibernate/">NHibernate</a>(7)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/AOP/">AOP</a>(7)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/IoC/">IoC</a>(5)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/%e4%be%9d%e8%b5%96%e6%b3%a8%e5%85%a5/">依赖注入</a>(4)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/NVelocity/">NVelocity</a>(4)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/WCF/">WCF</a>(3)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/ASP.NET+MVC/">ASP.NET MVC</a>(3)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/Linq/">Linq</a>(3)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/DI/">DI</a>(3)</li><li><a href="http://www.cnblogs.com/GoodHelper/tag/">更多</a></li>
</ul>
</div>
<div class="catListPostCategory">
<h3 class="catListTitle">随笔分类<span style="font-size: 11px; font-weight: normal;">(36)</span></h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/GoodHelper/category/214139.html">NHibernate(7)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to NHibernate(7)" href="http://www.cnblogs.com/GoodHelper/category/214139.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/GoodHelper/category/215413.html">Spring.NET(29)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to Spring.NET(29)" href="http://www.cnblogs.com/GoodHelper/category/215413.html/rss">(rss)</a></li>

</ul>

</div>

<div class="catListPostArchive">
<h3 class="catListTitle">随笔档案<span style="font-size: 11px; font-weight: normal;">(28)</span></h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/GoodHelper/archive/2009/11.html">2009年11月 (20)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/GoodHelper/archive/2009/10.html">2009年10月 (8)</a> </li>

</ul>

</div>

<div class="catListArticleCategory">
<h3 class="catListTitle">文章分类</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://www.cnblogs.com/GoodHelper/category/214956.html">Spring.NET</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to Spring.NET" href="http://www.cnblogs.com/GoodHelper/category/214956.html/rss">(rss)</a></li>

</ul>

</div>

<div class="catListImageCategory">
<h3 class="catListTitle">相册</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl01_Link" href="http://www.cnblogs.com/GoodHelper/gallery/219559.html">广州宿舍</a> </li>

</ul>

</div>



<div class="catListBlogRank">
<h3 class="catListTitle">积分与排名</h3>
<ul>
	<li class="liScore">
		积分 -	51055
	</li><li class="liRank">
		排名 -	1473
	</li>
</ul>
</div>



<div class="catListEssay">
<h3 class="catListTitle">最新随笔</h3>
<ul>
	
	
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl00_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/21/SpringNet_blogs.html">1.&nbsp;Spring.NET学习笔记——前言</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl01_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/20/SpringNet_NVelocity.html">2.&nbsp;Spring.NET学习笔记26——整合NVelocity(应用篇) Level 200</a></li>
		
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl01_RecentPostsList2_ctl01_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/20/SpringNet_Index.html">3.&nbsp;Spring.NET学习笔记——目录(原)</a></li>
		
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl01_RecentPostsList2_ctl02_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/20/SpringNet_QuartzNet.html">4.&nbsp;Spring.NET学习笔记25——整合Quartz.NET(应用篇) Level 200</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl02_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/19/SpringNet_WebService.html">5.&nbsp;Spring.NET学习笔记21——整合Web Service(应用篇) Level 200</a></li>
		
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl02_RecentPostsList2_ctl01_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/19/SpringNet_Remoting.html">6.&nbsp;Spring.NET学习笔记20——整合Remoting(应用篇) Level 200</a></li>
		
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl02_RecentPostsList2_ctl02_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/19/SpringNet_Nhibernate_AspNetMvc.html">7.&nbsp;Spring.NET学习笔记19——整合NHibernate和ASP.NET MVC(基础篇) Level 300</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl03_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/18/SpringNet_NHibernate.html">8.&nbsp;Spring.NET学习笔记18——整合NHibernate(基础篇) Level 300</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl04_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/17/SpringNet_Transaction_Required.html">9.&nbsp;Spring.NET学习笔记17——事务传播行为(基础篇) Level 200</a></li>
		
			
	
			<li><a id="SingleColumn1_ctl06_RecentPostsList_ctl05_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/16/SpringNet_Transaction.html">10.&nbsp;Spring.NET学习笔记16——事务管理(应用篇) Level 200</a></li>
		
		
</ul>
</div>

<div class="catListComment">
<h3 class="catListTitle">最新评论<a id="SingleColumn1__1c5f994_RSSHyperlink1" title="RSS订阅最最新评论" href="http://www.cnblogs.com/GoodHelper/CommentsRSS.aspx"><img title="RSS订阅最最新评论" src="xml.gif" style="border-width: 0px;"></a></h3>

	
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__1c5f994_CommentList_ctl00_Hyperlink2" class="listitem" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/16/SpringNet_Transaction.html#1746723">1.&nbsp;Re:Spring.NET学习笔记16——事务管理(应用篇) Level 200</a>
			</div>
			<div class="divRecentComment">
				这么好的文章为啥没人评论呢？
一直看楼主的这一系列文章，写的很好，对我有很大帮助。
再次感谢楼主，希望能多出好文章。 (轻风随风)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__1c5f994_CommentList_ctl01_Hyperlink2" class="listitem" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/19/SpringNet_Nhibernate_AspNetMvc.html#1746697">2.&nbsp;Re:Spring.NET学习笔记19——整合NHibernate和ASP.NET MVC(基础篇) Level 300</a>
			</div>
			<div class="divRecentComment">
				今天带给大家的就是期待以久的ASP.NET MVC与Spring.NET和NHibernate的组合，视图打造.NET版的SSH(Spring-Struts-Hibernate)

很好很强大！ (shmilgmy)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__1c5f994_CommentList_ctl02_Hyperlink2" class="listitem" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/21/SpringNet_blogs.html#1746691">3.&nbsp;Re:Spring.NET学习笔记——前言</a>
			</div>
			<div class="divRecentComment">
				支持！期待lz王者归来:) (shmilgmy)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__1c5f994_CommentList_ctl03_Hyperlink2" class="listitem" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/11/SpringNet_Life.html#1741365">4.&nbsp;Re:Spring.NET学习笔记11——自定义对象行为(基础篇) Level 200</a>
			</div>
			<div class="divRecentComment">
				有点迷糊了，第二部分没看明白。
莫非只是“配置”上的继承，仅是为了简化配置的编写？ (鹤冲天)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__1c5f994_CommentList_ctl04_Hyperlink2" class="listitem" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/11/SpringNet_Method.html#1741362">5.&nbsp;Re:Spring.NET学习笔记10——方法的注入(基础篇) Level 200</a>
			</div>
			<div class="divRecentComment">
				不可思议，没想到.Net也能这样用！ (鹤冲天)
			</div>		
		
</div>

<div class="catListView">
<h3 class="catListTitle">阅读排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/10/SpringNET_Framework_Step1.html">1.&nbsp;Spring.NET企业架构实践之 JQuery +  FlexiGrid + ASP.NET MVC + NVelocity + WCF + LINQ + NHibernate 综合应用(4063)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html">2.&nbsp;Spring.NET学习笔记1——控制反转(基础篇) Level 200(3087)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/16/linq2nhibernate.html">3.&nbsp;10分钟搞定Linq to NHibernate(一)——环境篇(2869)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/SpringNET_Config.html">4.&nbsp;Spring.NET学习笔记2——环境搭建(基础篇) Level 200(2467)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/SpringNET_Create.html">5.&nbsp;Spring.NET学习笔记4——对象的创建(基础篇) Level 200(1947)</a>
			</li>
		
			</ul>
		
</div>

<div class="catListFeedback">
<h3 class="catListTitle">评论排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/11/10/SpringNET_Framework_Step1.html">1.&nbsp;Spring.NET企业架构实践之 JQuery +  FlexiGrid + ASP.NET MVC + NVelocity + WCF + LINQ + NHibernate 综合应用(29)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/16/linq2nhibernate.html">2.&nbsp;10分钟搞定Linq to NHibernate(一)——环境篇(28)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/Spring_NET_IoC.html">3.&nbsp;Spring.NET学习笔记1——控制反转(基础篇) Level 200(22)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/25/SpringNET_Create.html">4.&nbsp;Spring.NET学习笔记4——对象的创建(基础篇) Level 200(19)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/GoodHelper/archive/2009/10/26/SpringNET_DI.html">5.&nbsp;Spring.NET学习笔记6——依赖注入(应用篇) Level 300(17)</a>
			</li>
		
			</ul>
		
</div>

			</div>
			
		</div><!--end: sideBarMain -->
	</div><!--end: sideBar 侧边栏容器 -->
	<div class="clear"></div>
	</div><!--end: main -->
	<div class="clear"></div>
	<div id="footer">
		
<!--done-->
Copyright ©2010 刘冬.NET
	</div><!--end: footer -->
</div><!--end: home 自定义的最大容器 --><a href="http://www.cnzz.com/stat/website.php?web_id=1738003" target="_top" title="站长统计"><img src="pic1.gif" border="0" hspace="0" vspace="0"></a><img src="stat.htm" border="0" height="0" width="0">

    </form>
	
	
      
    
    
    
</body>
</html>
